package setup

import (
	"flag"
	"tone-agent/entity"
)

var (
	ShowVersion   bool
	ShowInfo	  bool
	ShowVersionList   bool
	HeartbeatTest bool
	ShowConfig    bool
	ShowLog       bool
	Restart       bool
	Port          int
	Debug         bool
	Update        bool
	Upgrade       string
	SetTSN        string
	SetMode       string
	SetProxy      string
)

func ParseFlags() {
	flag.BoolVar(&ShowVersion, "v", false, "display version information")
	flag.BoolVar(&ShowInfo, "info", false, "display service information")
	flag.BoolVar(&ShowVersionList, "l", false, "display the list of available versions")
	flag.BoolVar(&HeartbeatTest, "test", false, "send heartbeat test")
	flag.BoolVar(&ShowConfig, "config", false, "show config")
	flag.BoolVar(&ShowLog, "log", false, "show log")
	flag.BoolVar(&Restart, "restart", false, "restart service")
	flag.IntVar(&Port, "p", entity.APPPort, "specified port number")
	flag.BoolVar(&Debug, "debug", false, "debug mode")
	flag.BoolVar(&Update, "update", false, "update service to latest")
	flag.StringVar(&Upgrade, "upgrade", "", "upgrade the version of agent[latest|stable|$version]")
	flag.StringVar(&SetTSN, "set-tsn", "", "set config of tsn")
	flag.StringVar(&SetMode, "set-mode", "", "set config of mode[active|passive]")
	flag.StringVar(&SetProxy, "set-proxy", "", "set config of proxy")
	flag.Parse()
}
